nohup /root/Sysbench.sh >> sysbench.log 2>&1 &

#删除测试
sysbench /root/sysbench_install/share/sysbench/oltp_delete.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_delete.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_delete.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_delete.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_delete.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_delete.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_delete.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_delete.lua_cleanup_16.log
sleep 60


#插入测试
sysbench /root/sysbench_install/share/sysbench/oltp_insert.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_insert.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_insert.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_insert.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_insert.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_insert.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_insert.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_insert.lua_cleanup_16.log
sleep 60


#主键查询测试
sysbench /root/sysbench_install/share/sysbench/oltp_point_select.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_point_select.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_point_select.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_point_select.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_point_select.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_point_select.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_point_select.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_point_select.lua_cleanup_16.log
sleep 60


#只读测试
sysbench /root/sysbench_install/share/sysbench/oltp_read_only.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_read_only.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_read_only.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_read_only.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_read_only.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_read_only.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_read_only.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_read_only.lua_cleanup_16.log
sleep 60



#读写测试（包含查询，更新，删除，插入操作）
sysbench /root/sysbench_install/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_read_write.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_read_write.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_read_write.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_read_write.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_read_write.lua_cleanup_16.log
sleep 60


#更新索引测试
sysbench /root/sysbench_install/share/sysbench/oltp_update_index.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_update_index.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_update_index.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_update_index.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_update_index.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_update_index.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_update_index.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_update_index.lua_cleanup_16.log
sleep 60


#更新非索引测试
sysbench /root/sysbench_install/share/sysbench/oltp_update_non_index.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_update_non_index.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_update_non_index.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_update_non_index.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_update_non_index.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_update_non_index.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_update_non_index.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_update_non_index.lua_cleanup_16.log
sleep 60




#只写测试（包含更新，删除，插入操作）
sysbench /root/sysbench_install/share/sysbench/oltp_write_only.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> oltp_write_only.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_write_only.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_write_only.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> oltp_write_only.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> oltp_write_only.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/oltp_write_only.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> oltp_write_only.lua_cleanup_16.log
sleep 60

#随机多个查询(in 里面多个查询条件)
sysbench /root/sysbench_install/share/sysbench/select_random_points.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> select_random_points.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> select_random_points.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/select_random_points.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> select_random_points.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> select_random_points.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/select_random_points.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> select_random_points.lua_cleanup_16.log
sleep 60



#随机范围查询(between … and …)
sysbench /root/sysbench_install/share/sysbench/select_random_ranges.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 prepare>> select_random_ranges.lua_prepare_16.log
date +'%Y-%m-%d %H:%M:%S' >> select_random_ranges.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/select_random_ranges.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 --time=300 --report-interval=1 run >> select_random_ranges.lua_run_16.log
date +'%Y-%m-%d %H:%M:%S' >> select_random_ranges.lua_run_16.log
sysbench /root/sysbench_install/share/sysbench/select_random_ranges.lua --db-driver=mysql --mysql-db=sysbenchdb --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=rootroot --table-size=100000 --tables=100 --threads=16 cleanup >> select_random_ranges.lua_cleanup_16.log
sleep 1